package com.ljfiction.book.adapter;

import android.graphics.Color;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ljfiction.book.Baner.AddBookBean;
import com.ljfiction.book.R;
import com.zhy.autolayout.utils.AutoUtils;

import java.util.List;

/**
 * Created by Administrator on 2017/7/24.
 */

public class ClassifyAddBookAdapter extends BaseQuickAdapter<AddBookBean.DataBean.ClassificationListBean,BaseViewHolder> {

    public ClassifyAddBookAdapter(@LayoutRes int layoutResId, @Nullable List<AddBookBean.DataBean.ClassificationListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AddBookBean.DataBean.ClassificationListBean item) {
        AutoUtils.autoSize(helper.itemView);
        if (item.isCleck()) {
            helper.getView(R.id.classify_item).setBackgroundResource(R.drawable.shap_jianbian);
            helper.setTextColor(R.id.classify_item,Color.parseColor("#ffffff"));
        } else {
            helper.getView(R.id.classify_item).setBackgroundResource(R.drawable.shape_jianbianselect);
            helper.setTextColor(R.id.classify_item,Color.parseColor("#333333"));
        }
        helper.setText(R.id.classify_item,item.getClassificationname());
    }


    }





